import axios from "axios";
import { getUserInfo, setUserInfo, getAuthenticatedStatus, switchAuthticatedStatus } from "@/store/modules/userStorage.js";
export default {
  namespaced: true,
  //写成函数，保证数据独立性
  state() {
    return {
      userInfo: getUserInfo(),
      isAuthenticated: getAuthenticatedStatus(),
    };
  },
  mutations: {
    setUserInfo(state, payload) {
      state.userInfo = payload;
      setUserInfo(payload);
    },
    swithAuth(state){
        state.isAuthenticated = switchAuthticatedStatus();
    }
  },
  actions: {},
  getters: {},
};
